<extend name="Layout/main" />
<block name="css"></block>
<block name="style"></block>
<block name="js"></block>
<block name="script"></block>
<block name="model">账户管理</block>
<block name="controller">角色管理</block>
<block name="action">新增角色</block>
<block name="desc"></block>
<block name="content">
<div class="row">
	<form class="form-horizontal" action="{:U('save')}" method="post" rel-action="form">
	<div class="col-md-3">
		<div class="box box-danger">
			<div class="box-header with-border">
				<h3 class="box-title">选择权限</h3>
			</div>
			<div class="box-body table-responsive">
				<table class="table table-striped table-condensed table-bordered">
					<volist name="level" id="item">
						<tr>
							<td><strong>{$item.level_name}</strong></td>
						</tr>
						<volist name="item.level" id="items">
						<tr>
							<td>
								<label class="font-light">
								<if condition="$items.level_default == 1">
									<input name="raw[{$items.level_id}]" value="{$items.level_data}" type="checkbox" checked>{$items.level_name} - {$items.level_data}
								<else />
									<input name="raw[{$items.level_id}]" value="{$items.level_data}" type="checkbox">{$items.level_name} - {$items.level_data}
								</if>
								</label>
							</td>
						</tr>
						</volist>
					</volist>
				</table>
			</div>	
		</div>
	</div>
	<div class="col-md-9">
		<div class="box box-danger">
			<div class="box-header with-border">
				<h3 class="box-title">角色信息</h3>
			</div>
			<div class="box-body">
				<div class="form-group">
					<label class="col-sm-2 control-label"><span class="text-red">*</span>标题</label>
					<div class="col-sm-10">
						<input type="text" class="form-control" name="name" value="{$data.role_name}" placeholder="请输入标题"  autocomplete="off">
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label">描述</label>
					<div class="col-sm-10">
						<input type="text" class="form-control" name="desc" value="{$data.role_desc}" placeholder="请输入描述"  autocomplete="off">
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label">排序</label>
					<div class="col-sm-10">
						<input type="number" class="form-control" name="order" value="{$data.role_order}" placeholder="请填写整数，数字越小越靠前" autocomplete="off">
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label">状态</label>
					<div class="col-sm-10 radio">
						<label>
							<if condition="$data.role_state == 1">
								<input type="radio" name="state" value="1" checked="checked">正常
							<else />
								<input type="radio" name="state" value="1">正常
							</if>
						</label>
						<label>
							<if condition="$data.role_state == 0">
								<input type="radio" name="state" value="0" checked="checked">锁定
							<else />
								<input type="radio" name="state" value="0">锁定
							</if>
						</label>
					</div>
				</div>
			</div>
			<input type="hidden" name="id" value="{$data.role_id}">
			<div class="box-footer">
				<div class="col-sm-offset-2 col-sm-10">
					<button type="submit" class="btn btn-default">保存</button>
					<button type="reset" class="btn btn-default">重置</button>
					<button type="button" class="btn btn-default" rel-action="cancel">取消</button>
				</div>
			</div>
		</div>
	</div>
	</form>
</div>
</block>